package constant

// topic
const (
	/* 订阅 */
	// 订阅商品中心消息
	TopicProdUpdate = "prod-prod_updated" // 订阅商品更新消息
	TopicProdDelete = "prod-prod_deleted" // 订阅商品删除消息
	// 订阅商城消息
	TopicMallBizCancel = "mall-biz_cancel"      // 商城请求下单后取消支付（需要关闭冻结单）
	TopicMallPromotion = "mall-order_promotion" // 商城转化分摊消息
	// 订阅消息
	// 仓库订阅(其他多个业务系统生产)
	TopicOrderNotify = "inventory-order_notify" // 通用
	Topic
	// 订阅品牌管理消息（本期产品定义仓库信息不随门店更新）
	//TopicStoreUpdate = "admin_store-update" // 订阅admin店铺更新消息
	/* 通知 */
	// 发送消息给会员服务
	TopicMemberMsg = "member-send_msg" // 发送Bmember模板消息
	/* 生产 */
	TopicInventoryStatus = "inventory-order_update" // 发送履约单更新消息
	TopicWarehouseUpdate = "inventory-update"       // 发送仓库信息变更消息

)

// 库存订单类型
const (
	OrderTypeInventory        = iota + 1 // 盘点单
	OrderTypeLoss                        // 报损单
	OrderTypePurchase                    // 采购单
	OrderTypeSchedule                    // 调拨单
	OrderTypeFreezeByCustomer            // C端冻结单
	OrderTypeProcess                     // 发货单(正向履约单)
	OrderTypeRefund                      // 退货单(负向履约单)
	OrderTypeExpress                     // 配送单
	//OrderTypePos                         // pos单(系统不需要为pos单生成独立单号)
)

// 方向标记
const (
	DirectionIn  = iota + 1 // 采购入库
	DirectionOut            // 采购退货
)

// 盘点单状态
const (
	InventoryOrderCanceled   = iota // 已取消
	InventoryOrderProcessing        // 进行中
	InventoryOrderDone              // 已生效
)

// 采购单状态
const (
	PurchaseOrderDone = 1 // 已生效
)

// 调拨单状态
const (
	ScheduleOrderCreated  = iota + 1 // 订单创建
	ScheduleOrderAudited             // 订单已审核
	ScheduleOrderStored              // 订单已入库
	ScheduleOrderRejected            // 订单已拒绝
)

// 报损单状态
const (
	LossOrderDone = 1 // 已生效
)

// 仓库状态
const (
	WarehouseDeleted  = iota // 已删除
	WarehouseEnable          // 启用
	WarehouseDisable         // 停用
	WarehouseAbnormal        // 异常
)

// 仓库存储模式
const (
	//WarehouseStorageModeWeak   = iota // 弱管控
	WarehouseStorageModeStrong = iota + 1 // 强管控
)

// 物流配置状态
const (
	//ExpressApplying   = iota // 申请中
	ExpressConfigured = iota + 1 // 已配置
	//ExpressRejected          // 已拒绝
	ExpressUnbound // 已解绑
)

// 物流平台配置模式
const (
	ExpressPlatformModeInitiative = iota + 1 // 手动配置
	//ExpressPlatformModeOperation             // 运维配置
)

// 物料类型状态
const (
	MaterialTypeValid = 1 // 已生效
)

// 单位状态
const (
	UnitValid = 1 // 已生效
)

// 物料状态
const (
	MaterialValid = 1 // 已生效
)

// 履约明细状态
const (
	ProcessDetailInit      = 0
	ProcessDetailShipped   = 1
	ProcessDetailCancelled = 2
)

// 冻结单状态
const (
	FreezeOrderCancelled  = 0 // 已结束
	FreezeOrderInit       = 1 // 已冻结待使用
	FreezeOrderProcessing = 2 // 已使用待扣库
	FreezeOrderFinished   = 3 // 已完结
)

// bom状态
const (
	BomDeleted = 0 // 已删除
	BomValid   = 1 // 有效
)

// 预计费请求状态
const (
	CalculateRequestInit     = 0 // 初始
	CalculateRequestFrozen   = 1 // 已冻结
	CalculateRequestFINISHED = 2 // 已完结（已创建履约）
)

// 子权限
const (
	VisitMaterialConfig        = "VISIT_MATERIAL_CONFIG"
	ModifyMaterialConfig       = "MODIFY_MATERIAL_CONFIG"
	VisitWarehouseConfig       = "VISIT_WAREHOUSE_CONFIG"
	ModifyWarehouseConfig      = "MODIFY_WAREHOUSE_CONFIG"
	VisitMaterialProdRelation  = "VISIT_MATERIAL_PROD_RELATION"
	ModifyMaterialProdRelation = "MODIFY_MATERIAL_PROD_RELATION"
	VisitWarehouseData         = "VISIT_WAREHOUSE_DATA"
	MakeInventory              = "MAKE_INVENTORY"
	ReviewInventory            = "REVIEW_INVENTORY"
	CreatePurchasingOrder      = "CREATE_PURCHASING_ORDER"
	ScheduleIn                 = "SCHEDULE_IN"
	ScheduleOut                = "SCHEDULE_OUT"
	CreateConsumptionOrder     = "CREATE_CONSUMPTION_ORDER"
	VisitPurchasingOrder       = "VISIT_PURCHASING_ORDER"
	VisitSchedulingOrder       = "VISIT_SCHEDULING_ORDER"
	VisitConsumptionOrder      = "VISIT_CONSUMPTION_ORDER"
	DeliveryManagement         = "DELIVERY_MANAGEMENT"
	RefundManagement           = "REFUND_MANAGEMENT"
	VisitMonthlySales          = "VISIT_MONTHLY_SALES"
)

// ActionType
const (
	ActionPurchaseIn  = iota + 1 // 采购入库
	ActionPurchaseOut            // 采购出库
	ActionScheduleIn             // 调拨入库
	ActionScheduleOut            // 调拨出库
	ActionInventory              // 盘点差额
	ActionLoss                   // 损耗差额
)

// unitType
const (
	UnitTypePurchase = 1 // 采购单位类型
	UnitTypeStorage  = 2 // 库存单位类型
)

// fetchMode
const (
	//FetchModeALL            = 0 // 品牌下&仓库内商品合集（采购， 调拨，盘点，损耗）
	FetchModeFollowPStoreID = 1 // 跟随总部门店属性，仅获取模式下商品（bom配置）
)

// ExpressPlatform
const (
	ExpressShunfeng = 1
	ExpressDada     = 2
)

// NSQ status
const (
	NSQInit    = 0 // 消息初始化
	NSQSucceed = 1 // 消息发送成功
	//NSQMarked  = 2 // 消息标记成功
)
